<template>
    <div class="box_">
        <div class="content">
            <h3>温馨提示</h3>
            <p>{{content}}</p>
           <div class="choose">
               <button @click="confirm" class="warning" >确认</button>
               <button @click="down">取消</button>
           </div>
        </div>
    </div>
</template>

<script>
export default {
    name: "PromptWindow",
    props:{
        info:{

        },
        index:{
            type: String,Number
        },
        content:{
            type: String,
            default: "该操作无法撤回，是否确认删除？"
        }
    },
    methods: {
        down() {
            this.$emit("confirm",this.index,false);
        },
        confirm(){
            this.$emit("confirm",this.index,true);

        }
    }
}
</script>

<style scoped>
.box_ {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(54, 53, 53, 0.1);
    margin: auto;
    z-index: 9999;
    animation: box_ .5s ease-in-out 0s 1 forwards;
}

.content {
    /*background: white;*/
}

.content {
    position: relative;
    width: 350px;
    height: 200px;
    padding: 0 10px;
    background: white;
    border-radius: 2px;
    box-shadow: 0 0 15px -1px #d5d5d5;
    animation: box_window .3s ease-in-out 0s 1 forwards;
}
@keyframes box_window {
    0%{
        transform: scale(0);
    }
    90%{
        transform: scale(1.1);
    }
    100%{
        transform: scale(1);
    }
}
h3 {
    padding: 5px 0;
    text-align: center;
}

p {
    text-indent: 1rem;
    word-break: break-all;
    height: 110px;
    background: #b1b4b4;
    overflow: auto;
    padding: 10px 10px;
    color: white;
    letter-spacing: 1px;
}

/* 一般浏览器的不要太小，容易看不见 */
p::-webkit-scrollbar {
    width: 5px;
}

p::-webkit-scrollbar-thumb {
    border-radius: 1px;
    background: #f1c3d5;
}

p::-webkit-scrollbar-track {
    border-radius: 0;
    background: #f9f9fc;
}
.choose{
    width: 100%;
    position: absolute;
    bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}
button {
    background: #3586f1;
    color: white;
    transition: all .3s;
    outline: none;
    border: 0;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 3px;
}
button:hover {
    opacity: .8;
}
.warning{
    background: #ee4f4f;
    margin-right: 20px;
}
</style>